<template>
<div class="center">
  <el-table :data="list" style="width: 100%">
    <el-table-column prop="date" label="日期" width="180px"> </el-table-column>
    <el-table-column prop="id" label="消防箱编号" width="180px"> </el-table-column>
    <el-table-column prop="address" label="地址"> </el-table-column>
    <el-table-column prop="contacts" label="负责人姓名" width="180px"> </el-table-column>
    <el-table-column prop="confirm" label="是否检查" width="180px">
      <template slot-scope="scope">
          <span v-if="scope.row.confirm == 1">已检查</span>
          <span v-if="scope.row.confirm == 0">未检查</span>
        </template>
    </el-table-column>
  </el-table>
</div>
</template>

<script>
export default {
  created(){
    this.query();
  },
  data() {
    return {
      list:[]
    };
  },
  methods: {
    query(){
      this.axios("http://localhost:3000/test").then((response) =>{
        this.list=response.data;
      }).catch((error) =>{

      });
    }
  },
};
</script>

<style>
</style>

